package com.lanchetech.dao;

import com.lanchetech.bean.request.PageReq;
import com.lanchetech.entity.CourseComment;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface CourseCommentMapper {
    int deleteByPrimaryKey(Long id);

    int insert(CourseComment record);

    int insertSelective(CourseComment record);

    CourseComment selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(CourseComment record);

    int updateByPrimaryKey(CourseComment record);

    int deleteByCourseId(@Param("courseId")Long courseId);

    int deleteByCourseIdAndUserId(@Param("courseId")Long courseId,@Param("userId")Long userId);

    int deleteByUserIdAndId(@Param("userId")Long userId,@Param("id")Long id);

    List<CourseComment> findAllPage(PageReq req);

    int addOneGoodCountById(@Param("id") Long id);

    int subOneGoodCountById(@Param("id") Long id);

    int addOneCommentCountById(@Param("id") Long id);

    int subOneCommentCountById(@Param("id") Long id);
}